Python Program to Concatenate Two Strings
Write a Python program to concatenate two string and print the result. Also create a example to take user input of two strings and concatenate and print the result.
Using + symbol to concatenate two different strings together and get result string.
Example
A sample Python program to assgin static string to two variables and then concatenate. Then print the result string with print() function.
1 2 3 4 5 | str1 = "Hello" str2 = "TecAdmin" result = str1 + str2 print(result) |
Another example to take input from user and concatenate them.
1 2 3 4 5 | str1 = input("Enter first string: ") str2 = input("Enter second string: ") result = str1 + str2 print(result) |